import { getAction, postAction } from '@/api/manage'

// 获取全局配置
const globalConfig = (params) => getAction('/admin/generateConfig/globalConfig', params)
// 获取当前表配置
const tableConfig = (params) => getAction('/admin/generateConfig/tableConfig', params)
// 编辑全局配置
const updateGlobalConfig = (params) => postAction(`/admin/generateConfig/updateGlobal`, params)
// 编辑表配置
const updateTableConfig = (params) => postAction(`/admin/generateConfig/updateTable`, params)
// 重置全局配置
const resetGlobalConfig = (params) => postAction(`/admin/generateConfig/deleteGlobal`)
// 重置当前表配置
const resetTableConfig = (params) => postAction(`/admin/generateConfig/delete/${params}`)
// 获取列配置
const list = (params) => getAction('/admin/generateColumn/list', params)
// 编辑列配置
const updateColumn = (params) => postAction('/admin/generateColumn/update', params)
// 重置列配置
const resetColumn = (params) => postAction(`/admin/generateColumn/delete/${params}`)

export {
  globalConfig,
  tableConfig,
  updateGlobalConfig,
  updateTableConfig,
  resetGlobalConfig,
  resetTableConfig,
  list,
  updateColumn,
  resetColumn
}
